package com.niit.session15;

public class LoginService {
	
	public static void main(String[] args) {
		LoginService loginService = new LoginService();
		loginService.register("Trout", "123456", "123123123@qq.com", "13877750255");
	}
	
	public void register(String username,String password,String emial,String phone) {
		boolean validEmail = Valid.validEmail(emial);
		if(!validEmail) {
			System.out.println("邮箱格式错误！");
			return;
		}
		if(!Valid.validPhone(phone)) {
			System.out.println("手机号码格式错误！");
			return;
		}
		System.out.println("用户注册成功！");
		
	}

}
